inherited fmAddDovLitsa: TfmAddDovLitsa
  Left = 488
  Top = 81
  Width = 1279
  Height = 884
  Caption = #1044#1086#1074#1077#1088#1077#1085#1085#1099#1077' '#1083#1080#1094#1072
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 819
    Width = 1263
  end
  inherited Panel1: TPanel
    Width = 1263
    inherited BitBtn1: TBitBtn
      Left = 1101
    end
    inherited BitBtn2: TBitBtn
      Left = 1189
    end
  end
  object cxPageControl1: TcxPageControl [2]
    Left = 0
    Top = 45
    Width = 1263
    Height = 774
    ActivePage = tsSpisok
    Align = alClient
    TabOrder = 2
    ClientRectBottom = 773
    ClientRectLeft = 1
    ClientRectRight = 1262
    ClientRectTop = 21
    object tsSpisok: TcxTabSheet
      Caption = #1057#1087#1080#1089#1086#1082
      ImageIndex = 0
      object GroupBox1: TGroupBox
        Left = 0
        Top = 0
        Width = 1261
        Height = 73
        Align = alTop
        Caption = #1055#1086#1083#1091#1095#1072#1090#1077#1083#1100' '#1091#1089#1083#1091#1075
        TabOrder = 0
        object Label5: TLabel
          Left = 8
          Top = 14
          Width = 23
          Height = 13
          Caption = #1060#1048#1054
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clGray
          Font.Height = -11
          Font.Name = 'Tahoma'
          Font.Style = []
          ParentFont = False
        end
        object Label6: TLabel
          Left = 420
          Top = 15
          Width = 80
          Height = 13
          Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clGray
          Font.Height = -11
          Font.Name = 'Tahoma'
          Font.Style = []
          ParentFont = False
        end
        object Label7: TLabel
          Left = 540
          Top = 15
          Width = 19
          Height = 13
          Caption = #1051#1077#1090
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clGray
          Font.Height = -11
          Font.Name = 'Tahoma'
          Font.Style = []
          ParentFont = False
        end
        object Label8: TLabel
          Left = 580
          Top = 15
          Width = 19
          Height = 13
          Caption = #1052#1077#1089
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clGray
          Font.Height = -11
          Font.Name = 'Tahoma'
          Font.Style = []
          ParentFont = False
        end
        object Label9: TLabel
          Left = 624
          Top = 15
          Width = 173
          Height = 13
          Caption = #1054#1073#1088#1072#1079#1086#1074#1072#1090#1077#1083#1100#1085#1086#1077' '#1087#1086#1076#1088#1072#1079#1076#1077#1083#1077#1085#1080#1077
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clGray
          Font.Height = -11
          Font.Name = 'Tahoma'
          Font.Style = []
          ParentFont = False
        end
        object cxDBTextEdit1: TcxDBTextEdit
          Left = 8
          Top = 29
          DataBinding.DataField = 'PP'
          DataBinding.DataSource = dlgDS
          ParentFont = False
          Properties.ReadOnly = True
          Style.Color = clMoneyGreen
          Style.Font.Charset = DEFAULT_CHARSET
          Style.Font.Color = clWindowText
          Style.Font.Height = -16
          Style.Font.Name = 'Tahoma'
          Style.Font.Style = [fsBold]
          Style.Shadow = True
          Style.IsFontAssigned = True
          TabOrder = 0
          Width = 401
        end
        object cxDBTextEdit2: TcxDBTextEdit
          Left = 420
          Top = 30
          DataBinding.DataField = 'PDATEBIRTH'
          DataBinding.DataSource = dlgDS
          ParentFont = False
          Properties.ReadOnly = True
          Style.Color = clMoneyGreen
          Style.Font.Charset = DEFAULT_CHARSET
          Style.Font.Color = clWindowText
          Style.Font.Height = -16
          Style.Font.Name = 'Tahoma'
          Style.Font.Style = [fsBold]
          Style.Shadow = True
          Style.IsFontAssigned = True
          TabOrder = 1
          Width = 113
        end
        object cxDBTextEdit3: TcxDBTextEdit
          Left = 540
          Top = 30
          DataBinding.DataField = 'LET'
          DataBinding.DataSource = dlgDS
          ParentFont = False
          Properties.ReadOnly = True
          Style.Color = clMoneyGreen
          Style.Font.Charset = DEFAULT_CHARSET
          Style.Font.Color = clWindowText
          Style.Font.Height = -16
          Style.Font.Name = 'Tahoma'
          Style.Font.Style = [fsBold]
          Style.Shadow = True
          Style.IsFontAssigned = True
          TabOrder = 2
          Width = 33
        end
        object cxDBTextEdit4: TcxDBTextEdit
          Left = 579
          Top = 30
          DataBinding.DataField = 'MES'
          DataBinding.DataSource = dlgDS
          ParentFont = False
          Properties.ReadOnly = True
          Style.Color = clMoneyGreen
          Style.Font.Charset = DEFAULT_CHARSET
          Style.Font.Color = clWindowText
          Style.Font.Height = -16
          Style.Font.Name = 'Tahoma'
          Style.Font.Style = [fsBold]
          Style.Shadow = True
          Style.IsFontAssigned = True
          TabOrder = 3
          Width = 33
        end
        object cxDBTextEdit5: TcxDBTextEdit
          Left = 624
          Top = 30
          DataBinding.DataField = 'OSN_PODR'
          DataBinding.DataSource = dlgDS
          ParentFont = False
          Properties.ReadOnly = True
          Style.Color = clMoneyGreen
          Style.Font.Charset = DEFAULT_CHARSET
          Style.Font.Color = clWindowText
          Style.Font.Height = -16
          Style.Font.Name = 'Tahoma'
          Style.Font.Style = [fsBold]
          Style.Shadow = True
          Style.IsFontAssigned = True
          TabOrder = 4
          Width = 401
        end
      end
      object gbDL: TGroupBox
        Left = 0
        Top = 145
        Width = 1261
        Height = 607
        Align = alClient
        Caption = #1044#1086#1074#1077#1088#1077#1085#1085#1099#1077' '#1083#1080#1094#1072
        Enabled = False
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clGray
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
        TabOrder = 1
        object ToolBar1: TToolBar
          Left = 2
          Top = 15
          Width = 1257
          AutoSize = True
          BorderWidth = 2
          EdgeInner = esNone
          EdgeOuter = esNone
          Images = DMInv.ilActive
          TabOrder = 0
          TabStop = True
          Transparent = True
          object ToolButton1: TToolButton
            Left = 0
            Top = 2
            Hint = #1044#1086#1073#1072#1074#1080#1090#1100'/'#1048#1079#1084#1077#1085#1080#1090#1100
            ImageIndex = 2
            ParentShowHint = False
            ShowHint = True
            Visible = False
            OnClick = ToolButton1Click
          end
          object ToolButton2: TToolButton
            Left = 23
            Top = 2
            Caption = 'ToolButton2'
            ImageIndex = 28
            OnClick = ToolButton2Click
          end
          object ToolButton3: TToolButton
            Left = 46
            Top = 2
            Caption = 'ToolButton3'
            ImageIndex = 29
            OnClick = ToolButton3Click
          end
          object ToolButton4: TToolButton
            Left = 69
            Top = 2
            Width = 8
            Caption = 'ToolButton4'
            ImageIndex = 19
            Style = tbsSeparator
          end
          object ToolButton5: TToolButton
            Left = 77
            Top = 2
            Caption = 'ToolButton5'
            ImageIndex = 18
            OnClick = ToolButton5Click
          end
        end
        object dbgDovLitsa: TcxGrid
          Left = 2
          Top = 47
          Width = 1257
          Height = 558
          Align = alClient
          TabOrder = 1
          LookAndFeel.Kind = lfStandard
          object tvDovLitsa: TcxGridDBTableView
            NavigatorButtons.ConfirmDelete = False
            NavigatorButtons.First.Visible = True
            NavigatorButtons.PriorPage.Visible = True
            NavigatorButtons.Prior.Visible = True
            NavigatorButtons.Next.Visible = True
            NavigatorButtons.NextPage.Visible = True
            NavigatorButtons.Last.Visible = True
            NavigatorButtons.Insert.Visible = False
            NavigatorButtons.Append.Visible = False
            NavigatorButtons.Delete.Visible = False
            NavigatorButtons.Edit.Visible = False
            NavigatorButtons.Post.Visible = False
            NavigatorButtons.Cancel.Visible = False
            NavigatorButtons.Refresh.Visible = False
            NavigatorButtons.SaveBookmark.Visible = False
            NavigatorButtons.GotoBookmark.Visible = False
            NavigatorButtons.Filter.Visible = False
            OnEditValueChanged = tvDovLitsaEditValueChanged
            DataController.DataSource = dsPDov
            DataController.Summary.DefaultGroupSummaryItems = <>
            DataController.Summary.FooterSummaryItems = <>
            DataController.Summary.SummaryGroups = <>
            OptionsBehavior.CellHints = True
            OptionsBehavior.IncSearch = True
            OptionsCustomize.ColumnFiltering = False
            OptionsCustomize.ColumnGrouping = False
            OptionsCustomize.ColumnSorting = False
            OptionsData.CancelOnExit = False
            OptionsData.DeletingConfirmation = False
            OptionsView.NavigatorOffset = 10
            OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
            OptionsView.CellAutoHeight = True
            OptionsView.CellTextMaxLineCount = 1
            OptionsView.ColumnAutoWidth = True
            OptionsView.GroupByBox = False
            OptionsView.Indicator = True
            OptionsView.ShowColumnFilterButtons = sfbAlways
            Preview.Visible = True
            Styles.Content = DMInv.cxData
            Styles.IncSearch = DMInv.cxKrasniyText
            Styles.Selection = DMInv.cxJoltiyFon
            Styles.Header = DMInv.cxSiniyText
            object tvDovLitsaPID: TcxGridDBColumn
              Caption = #1060#1048#1054
              DataBinding.FieldName = 'PID'
              PropertiesClassName = 'TcxLookupComboBoxProperties'
              Properties.DropDownRows = 20
              Properties.KeyFieldNames = 'PID'
              Properties.ListColumns = <
                item
                  Caption = #1060#1048#1054
                  FieldName = 'PP'
                end
                item
                  Caption = #1057#1090#1072#1090#1091#1089
                  MinWidth = 30
                  FieldName = 'SDNAME'
                end>
              Properties.ListSource = dsPeople
              Properties.OnEditValueChanged = tvDovLitsaPIDPropertiesEditValueChanged
              Width = 425
            end
            object tvDovLitsaDLSTATUS: TcxGridDBColumn
              Caption = #1050#1077#1084' '#1087#1088#1080#1093#1086#1076#1080#1090#1089#1103
              DataBinding.FieldName = 'DLSTATUS'
              PropertiesClassName = 'TcxLookupComboBoxProperties'
              Properties.DropDownRows = 40
              Properties.KeyFieldNames = 'SDID'
              Properties.ListColumns = <
                item
                  Caption = #1050#1077#1084' '#1087#1088#1080#1093#1086#1076#1080#1090#1089#1103' '#1088#1077#1073#1077#1085#1082#1091
                  FieldName = 'SDNAME'
                end>
              Properties.ListSource = dsLink
              Width = 147
            end
            object tvDovLitsaDSERIA: TcxGridDBColumn
              Caption = #1055#1072#1089#1087'. '#1089#1077#1088#1080#1103
              DataBinding.FieldName = 'DSERIA'
              Width = 54
            end
            object tvDovLitsaDNUMBER: TcxGridDBColumn
              Caption = #8470' '#1087#1072#1089#1087'.'
              DataBinding.FieldName = 'DNUMBER'
              Width = 71
            end
            object tvDovLitsaDDATE: TcxGridDBColumn
              Caption = #1044#1072#1090#1072' '#1074#1099#1076'.'
              DataBinding.FieldName = 'DDATE'
              PropertiesClassName = 'TcxDateEditProperties'
              Width = 70
            end
            object tvDovLitsaTEL_MOB: TcxGridDBColumn
              Caption = #1058#1077#1083'. '#1084#1086#1073'.'
              DataBinding.FieldName = 'TEL_MOB'
              PropertiesClassName = 'TcxMaskEditProperties'
              Properties.EditMask = '!\(999\)000-0000;1;_'
              Width = 84
            end
            object tvDovLitsaTEL_DOM: TcxGridDBColumn
              Caption = #1058#1077#1083'. '#1076#1086#1084'.'
              DataBinding.FieldName = 'TEL_DOM'
              PropertiesClassName = 'TcxMaskEditProperties'
              Properties.EditMask = '!\(999\)000-0000;1;_'
              Width = 81
            end
            object tvDovLitsaTEL_RAB: TcxGridDBColumn
              Caption = #1058#1077#1083'. '#1088#1072#1073'.'
              DataBinding.FieldName = 'TEL_RAB'
              PropertiesClassName = 'TcxMaskEditProperties'
              Properties.EditMask = '!\(999\)000-0000;1;_'
              Width = 94
            end
            object tvDovLitsaEMAIL: TcxGridDBColumn
              DataBinding.FieldName = 'EMAIL'
              Width = 223
            end
          end
          object cxGridLevel7: TcxGridLevel
            GridView = tvDovLitsa
          end
        end
      end
      object GroupBox2: TGroupBox
        Left = 0
        Top = 73
        Width = 1261
        Height = 72
        Align = alTop
        Caption = #1055#1086#1089#1090#1086#1103#1085#1085#1099#1081' '#1072#1076#1088#1077#1089' '#1088#1077#1073#1077#1085#1082#1072
        TabOrder = 2
        Visible = False
        object cxDBMemo1: TcxDBMemo
          Left = 2
          Top = 15
          Align = alClient
          DataBinding.DataField = 'CIVALUE'
          DataBinding.DataSource = dsContInfo
          ParentFont = False
          Style.Font.Charset = DEFAULT_CHARSET
          Style.Font.Color = clWindowText
          Style.Font.Height = -16
          Style.Font.Name = 'Tahoma'
          Style.Font.Style = []
          Style.IsFontAssigned = True
          TabOrder = 0
          Height = 55
          Width = 1257
        end
      end
    end
    object tsCopy: TcxTabSheet
      Caption = #1050#1086#1087#1080#1103
      ImageIndex = 1
      object Panel3: TPanel
        Left = 5
        Top = 32
        Width = 644
        Height = 737
        TabOrder = 0
        Visible = False
        object PdfViewer1: TPdfViewer
          Left = 1
          Top = 1
          Width = 642
          Height = 735
          Align = alClient
          About = 'Synactis PDF Viewer version 1.0'
          AutoOpen = False
          Copies = 1
          EndPage = 0
          FitMode = vmFitBoxHorz
          LayoutMode = lmDontCare
          PageMode = pmStandard
          ShowPrintDialog = True
          ShowScrollBars = True
          ShowToolBar = True
          ShrinkToMargins = True
          StartPage = 1
        end
      end
      object cxButton1: TcxButton
        Left = 3
        Top = 3
        Width = 175
        Height = 25
        Caption = #1044#1086#1073#1072#1074#1080#1090#1100'/'#1079#1072#1084#1077#1085#1080#1090#1100
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -13
        Font.Name = 'Tahoma'
        Font.Style = []
        ParentFont = False
        TabOrder = 1
        OnClick = cxButton1Click
        Align = alCustom
        Glyph.Data = {
          76010000424D7601000000000000760000002800000020000000100000000100
          04000000000000010000CE0E0000D80E00001000000000000000000000000000
          80000080000000808000800000008000800080800000C0C0C000808080000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
          3333333333387F3333333333333333333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333387FFFFFFFFFFFFF3344444444444433387777777F777777334444444444
          4433388888887F8888883333333443333333333333387F333333333333344333
          3333333333387F3333333333333443333333333333387F333333333333344333
          3333333333387F33333333333334433333333333333877333333333333333333
          3333333333388833333333333333333333333333333333333333}
        NumGlyphs = 2
      end
    end
  end
  inherited dlgDS: TDataSource
    Left = 704
    Top = 8
  end
  object qDocDov: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qDocDovAfterInsert
    AfterOpen = qDocDovAfterOpen
    BeforeOpen = qDocDovBeforeOpen
    CachedUpdates = True
    SQL.Strings = (
      'SELECT DDL.*, COALESCE(DDL.DDLTIMEEDIT, DDL.DDLTIMEENTER) AS T'
      'FROM DOC_DOV_LITSA DDL'
      'WHERE DDL.PID_POLUCH = :pid_poluch')
    UpdateObject = quDocDov
    Left = 496
    Top = 192
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'pid_poluch'
        ParamType = ptUnknown
      end>
    object qDocDovPID_POLUCH: TIntegerField
      FieldName = 'PID_POLUCH'
      Origin = '"DOC_DOV_LITSA"."PID_POLUCH"'
      Required = True
    end
    object qDocDovDDLSCAN: TBlobField
      FieldName = 'DDLSCAN'
      Origin = '"DOC_DOV_LITSA"."DDLSCAN"'
      ProviderFlags = [pfInUpdate]
      Size = 8
    end
    object qDocDovDDLUSERENTER: TIBStringField
      FieldName = 'DDLUSERENTER'
      Origin = '"DOC_DOV_LITSA"."DDLUSERENTER"'
      Size = 40
    end
    object qDocDovDDLTIMEENTER: TDateTimeField
      FieldName = 'DDLTIMEENTER'
      Origin = '"DOC_DOV_LITSA"."DDLTIMEENTER"'
    end
    object qDocDovDDLUSEREDIT: TIBStringField
      FieldName = 'DDLUSEREDIT'
      Origin = '"DOC_DOV_LITSA"."DDLUSEREDIT"'
      Size = 40
    end
    object qDocDovDDLTIMEEDIT: TDateTimeField
      FieldName = 'DDLTIMEEDIT'
      Origin = '"DOC_DOV_LITSA"."DDLTIMEEDIT"'
    end
    object qDocDovT: TDateTimeField
      FieldName = 'T'
      ProviderFlags = []
    end
  end
  object quDocDov: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PID_POLUCH,'
      '  DDLSCAN,'
      '  DDLUSERENTER,'
      '  DDLTIMEENTER,'
      '  DDLUSEREDIT,'
      '  DDLTIMEEDIT'
      'from DOC_DOV_LITSA '
      'where'
      '  PID_POLUCH = :PID_POLUCH')
    ModifySQL.Strings = (
      'update DOC_DOV_LITSA'
      'set'
      '  DDLSCAN = :DDLSCAN,'
      '  DDLTIMEEDIT = :DDLTIMEEDIT,'
      '  DDLTIMEENTER = :DDLTIMEENTER,'
      '  DDLUSEREDIT = :DDLUSEREDIT,'
      '  DDLUSERENTER = :DDLUSERENTER,'
      '  PID_POLUCH = :PID_POLUCH'
      'where'
      '  PID_POLUCH = :OLD_PID_POLUCH')
    InsertSQL.Strings = (
      'insert into DOC_DOV_LITSA'
      
        '  (DDLSCAN, DDLTIMEEDIT, DDLTIMEENTER, DDLUSEREDIT, DDLUSERENTER' +
        ', PID_POLUCH)'
      'values'
      
        '  (:DDLSCAN, :DDLTIMEEDIT, :DDLTIMEENTER, :DDLUSEREDIT, :DDLUSER' +
        'ENTER, '
      '   :PID_POLUCH)')
    DeleteSQL.Strings = (
      'delete from DOC_DOV_LITSA'
      'where'
      '  PID_POLUCH = :OLD_PID_POLUCH')
    Left = 528
    Top = 192
  end
  object dsDocDov: TDataSource
    DataSet = qDocDov
    Left = 464
    Top = 192
  end
  object odScan: TOpenDialog
    Filter = 'PDF|*.pdf'
    InitialDir = 'c:\'
    Left = 488
    Top = 280
  end
  object dsPDov: TDataSource
    DataSet = qPDov
    Left = 464
    Top = 232
  end
  object qPDov: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qPDovAfterInsert
    AfterPost = qPDovAfterPost
    BeforeOpen = qPDovBeforeOpen
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' '#39')||'#39 +
        ' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS fio, Sd.SDNAME, P.PDATEBIRTH' +
        ', ci.CIVALUE AS tel_dom,'
      
        '       ci1.CIVALUE AS tel_mob, ci2.CIVALUE AS tel_rab, PD.DSERIA' +
        ', PD.DNUMBER,'
      '       ci3.CIVALUE AS email, PD.DDATE, DL.*'
      'FROM DOV_LITSA DL'
      
        'left outer JOIN DOC_DOV_LITSA  DDL ON DL.PID_POLUCH = DDL.PID_PO' +
        'LUCH'
      'left outer JOIN PEOPLE P ON P.PID = DL.PID'
      'left outer JOIN SYS_DIC Sd ON sd.SDID = DL.DLSTATUS'
      
        'LEFT OUTER JOIN CONTACTINFO CI ON CI.PID = DL.PID AND CI.CITYPE ' +
        '= 1154'
      
        'LEFT OUTER JOIN CONTACTINFO CI1 ON CI1.PID = DL.PID AND CI1.CITY' +
        'PE = 1155'
      
        'LEFT OUTER JOIN CONTACTINFO CI2 ON CI2.PID = DL.PID AND CI2.CITY' +
        'PE = 1156'
      
        'LEFT OUTER JOIN CONTACTINFO CI3 ON CI3.PID = DL.PID AND CI3.CITY' +
        'PE = 1255'
      
        'LEFT OUTER JOIN P_DOCUMENTS PD ON PD.PID = DL.PID AND PD.DTYPE I' +
        'N (1050, 1464, 1465) AND PD.DMAINDOC IS NOT NULL AND PD.DISDELET' +
        'E IS NULL'
      'WHERE DL.PID_POLUCH = :PID AND P.PISDELETE IS NULL'
      'order by 1')
    UpdateObject = quPDov
    Left = 496
    Top = 232
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qPDovFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 767
    end
    object qPDovSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qPDovPDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPDovTEL_DOM: TIBStringField
      FieldName = 'TEL_DOM'
      Origin = '"CONTACTINFO"."CIVALUE"'
      Size = 255
    end
    object qPDovTEL_MOB: TIBStringField
      FieldName = 'TEL_MOB'
      Origin = '"CONTACTINFO"."CIVALUE"'
      Size = 255
    end
    object qPDovTEL_RAB: TIBStringField
      FieldName = 'TEL_RAB'
      Origin = '"CONTACTINFO"."CIVALUE"'
      Size = 255
    end
    object qPDovDSERIA: TIBStringField
      FieldName = 'DSERIA'
      Origin = '"P_DOCUMENTS"."DSERIA"'
      Size = 10
    end
    object qPDovDNUMBER: TIBStringField
      FieldName = 'DNUMBER'
      Origin = '"P_DOCUMENTS"."DNUMBER"'
    end
    object qPDovEMAIL: TIBStringField
      FieldName = 'EMAIL'
      Origin = '"CONTACTINFO"."CIVALUE"'
      Size = 255
    end
    object qPDovDDATE: TDateField
      FieldName = 'DDATE'
      Origin = '"P_DOCUMENTS"."DDATE"'
    end
    object qPDovPID_POLUCH: TIntegerField
      FieldName = 'PID_POLUCH'
      Origin = '"DOV_LITSA"."PID_POLUCH"'
      Required = True
    end
    object qPDovPID: TIntegerField
      FieldName = 'PID'
      Origin = '"DOV_LITSA"."PID"'
      Required = True
    end
    object qPDovDLSTATUS: TIntegerField
      FieldName = 'DLSTATUS'
      Origin = '"DOV_LITSA"."DLSTATUS"'
    end
    object qPDovDLNOTE: TIBStringField
      FieldName = 'DLNOTE'
      Origin = '"DOV_LITSA"."DLNOTE"'
      Size = 255
    end
    object qPDovDLUSERENTER: TIBStringField
      FieldName = 'DLUSERENTER'
      Origin = '"DOV_LITSA"."DLUSERENTER"'
      Size = 40
    end
    object qPDovDLTIMEENTER: TDateTimeField
      FieldName = 'DLTIMEENTER'
      Origin = '"DOV_LITSA"."DLTIMEENTER"'
    end
    object qPDovDLUSEREDIT: TIBStringField
      FieldName = 'DLUSEREDIT'
      Origin = '"DOV_LITSA"."DLUSEREDIT"'
      Size = 40
    end
    object qPDovDLTIMEEDIT: TDateTimeField
      FieldName = 'DLTIMEEDIT'
      Origin = '"DOV_LITSA"."DLTIMEEDIT"'
    end
  end
  object quPDov: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  FIO,'
      '  SDNAME,'
      '  PDATEBIRTH,'
      '  TEL_DOM,'
      '  TEL_MOB,'
      '  TEL_RAB,'
      '  DSERIA,'
      '  DNUMBER,'
      '  EMAIL,'
      '  DDATE,'
      '  PID_POLUCH,'
      '  PID,'
      '  DLSTATUS,'
      '  DLNOTE,'
      '  DLUSERENTER,'
      '  DLTIMEENTER,'
      '  DLUSEREDIT,'
      '  DLTIMEEDIT'
      'from DOV_LITSA '
      'where'
      '  PID = :PID and'
      '  PID_POLUCH = :PID_POLUCH')
    ModifySQL.Strings = (
      'update DOV_LITSA'
      'set'
      '  DLNOTE = :DLNOTE,'
      '  DLSTATUS = :DLSTATUS,'
      '  DLTIMEEDIT = :DLTIMEEDIT,'
      '  DLTIMEENTER = :DLTIMEENTER,'
      '  DLUSEREDIT = :DLUSEREDIT,'
      '  DLUSERENTER = :DLUSERENTER,'
      '  PID = :PID,'
      '  PID_POLUCH = :PID_POLUCH'
      'where'
      '  PID = :OLD_PID and'
      '  PID_POLUCH = :OLD_PID_POLUCH')
    InsertSQL.Strings = (
      'insert into DOV_LITSA'
      
        '  (DLNOTE, DLSTATUS, DLTIMEEDIT, DLTIMEENTER, DLUSEREDIT, DLUSER' +
        'ENTER, '
      '   PID, PID_POLUCH)'
      'values'
      
        '  (:DLNOTE, :DLSTATUS, :DLTIMEEDIT, :DLTIMEENTER, :DLUSEREDIT, :' +
        'DLUSERENTER, '
      '   :PID, :PID_POLUCH)')
    DeleteSQL.Strings = (
      'delete from DOV_LITSA'
      'where'
      '  PID = :OLD_PID and'
      '  PID_POLUCH = :OLD_PID_POLUCH')
    Left = 528
    Top = 232
  end
  object sqlContInfo: TIBSQL
    Database = DMInv.DBRead
    SQL.Strings = (
      'UPDATE OR INSERT INTO contactinfo  (ciid, pid, citype, civalue)'
      'VALUES (gen_id(gen_contactinfo, 1), :pid, :citype, :civalue)'
      'MATCHING (PID, CITYPE)')
    Transaction = DMInv.IBTransaction1
    Left = 587
    Top = 252
  end
  object dsPeople: TDataSource
    DataSet = qPeople
    Left = 40
    Top = 352
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' ' +
        #39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      '    SD.SDNAME, PS.SDID'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'WHERE P.PISDELETE IS NULL'
      'AND NOT EXISTS'
      '('
      'SELECT t1.sdid'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID)'
      '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 1470'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT   SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'WHERE t1.sdid = PS.SDID'
      ')'
      'AND PS.SDID <> 1254'
      'ORDER BY 3'
      ''
      '')
    Left = 72
    Top = 352
    object qPeoplePID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeoplePNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeoplePLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeoplePPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeoplePDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeoplePSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object qPeoplePNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPeoplePUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPeoplePTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPeoplePUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPeoplePTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPeoplePISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPeoplePP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPeopleSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qPeopleSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
  end
  object qLink: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID =7'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39' '#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'order by 1'
      ''
      '')
    Left = 159
    Top = 295
    object qLinkSDNAME: TIBStringField
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object qLinkSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qLinkSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qLinkSDISDELETE: TIntegerField
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
  object dsLink: TDataSource
    DataSet = qLink
    Left = 127
    Top = 293
  end
  object sqlPassport: TIBSQL
    Database = DMInv.DBRead
    SQL.Strings = (
      
        'UPDATE OR INSERT INTO p_documents  (did, pid, dtype, dseria, dnu' +
        'mber, dmaindoc, DDATE)'
      
        'VALUES (gen_id(gen_p_documents, 1), :pid, :dtype, :dseria, :dnum' +
        'ber, 1, :DDATE)'
      'MATCHING (PID, dtype)')
    Transaction = DMInv.IBTransaction1
    Left = 619
    Top = 252
  end
  object qCheckPodpisant: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT ap.pid'
      'FROM agr_poluch_uslug apu'
      'INNER JOIN agr_podpisant ap on ap.agid = apu.agid'
      'WHERE apu.pid = :pid and ap.ID_JURIDICAL_FACE is null')
    Left = 465
    Top = 147
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end>
  end
  object dsContInfo: TDataSource
    DataSet = qContInfo
    Left = 840
    Top = 168
  end
  object qContInfo: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qContInfoAfterInsert
    BeforeOpen = qContInfoBeforeOpen
    CachedUpdates = True
    SQL.Strings = (
      'SELECT CI.*, SD.SDNAME'
      'FROM CONTACTINFO CI'
      'INNER JOIN SYS_DIC SD ON SD.SDID = CI.CITYPE'
      'WHERE CI.PID = :PID and CI.citype = 1153')
    UpdateObject = quContInfo
    GeneratorField.Field = 'CIID'
    GeneratorField.Generator = 'GEN_CONTACTINFO'
    Left = 872
    Top = 168
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qContInfoCIID: TIntegerField
      FieldName = 'CIID'
      Origin = '"CONTACTINFO"."CIID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qContInfoPID: TIntegerField
      FieldName = 'PID'
      Origin = '"CONTACTINFO"."PID"'
      Required = True
    end
    object qContInfoCITYPE: TIntegerField
      FieldName = 'CITYPE'
      Origin = '"CONTACTINFO"."CITYPE"'
    end
    object qContInfoCIVALUE: TIBStringField
      DisplayLabel = #1047#1085#1072#1095#1077#1085#1080#1077
      FieldName = 'CIVALUE'
      Origin = '"CONTACTINFO"."CIVALUE"'
      Size = 255
    end
    object qContInfoCINOTE: TIBStringField
      DisplayLabel = #1055#1088#1080#1084#1077#1095#1072#1085#1080#1077
      FieldName = 'CINOTE'
      Origin = '"CONTACTINFO"."CINOTE"'
      Size = 255
    end
    object qContInfoCIUSERENTER: TIBStringField
      DisplayLabel = #1044#1086#1073#1072#1074#1080#1083
      FieldName = 'CIUSERENTER'
      Origin = '"CONTACTINFO"."CIUSERENTER"'
      Size = 40
    end
    object qContInfoCITIMEENTER: TDateTimeField
      DisplayLabel = #1044#1086#1073#1072#1074#1083#1077#1085#1086
      FieldName = 'CITIMEENTER'
      Origin = '"CONTACTINFO"."CITIMEENTER"'
    end
    object qContInfoCIUSEREDIT: TIBStringField
      DisplayLabel = #1048#1079#1084#1077#1085#1080#1083
      FieldName = 'CIUSEREDIT'
      Origin = '"CONTACTINFO"."CIUSEREDIT"'
      Size = 40
    end
    object qContInfoCITIMEEDIT: TDateTimeField
      DisplayLabel = #1048#1079#1084#1077#1085#1077#1085#1086
      FieldName = 'CITIMEEDIT'
      Origin = '"CONTACTINFO"."CITIMEEDIT"'
    end
    object qContInfoSDNAME: TIBStringField
      DisplayLabel = #1053#1072#1079#1074#1072#1085#1080#1077
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object quContInfo: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  CIID,'
      '  PID,'
      '  CITYPE,'
      '  CIVALUE,'
      '  CINOTE,'
      '  CIUSERENTER,'
      '  CITIMEENTER,'
      '  CIUSEREDIT,'
      '  CITIMEEDIT,'
      '  SDNAME'
      'from CONTACTINFO '
      'where'
      '  CIID = :CIID')
    ModifySQL.Strings = (
      'update CONTACTINFO'
      'set'
      '  CINOTE = :CINOTE,'
      '  CITIMEEDIT = :CITIMEEDIT,'
      '  CITIMEENTER = :CITIMEENTER,'
      '  CIUSEREDIT = :CIUSEREDIT,'
      '  CIUSERENTER = :CIUSERENTER,'
      '  CIVALUE = :CIVALUE,'
      '  PID = :PID'
      'where'
      '  CIID = :OLD_CIID and CITYPE = 1153')
    InsertSQL.Strings = (
      'insert into CONTACTINFO'
      
        '  (CINOTE, CITIMEEDIT, CITIMEENTER, CITYPE, CIUSEREDIT, CIUSEREN' +
        'TER, CIVALUE, '
      '   PID, CIID)'
      'values'
      
        '  (:CINOTE, :CITIMEEDIT, :CITIMEENTER, :CITYPE, :CIUSEREDIT, :CI' +
        'USERENTER, '
      '   :CIVALUE, :PID, :CIID)')
    DeleteSQL.Strings = (
      'delete from CONTACTINFO'
      'where'
      '  CIID = :OLD_CIID')
    Left = 904
    Top = 168
  end
end
